package service.impl;

import java.util.Map;

import dao.CartDao;
import dao.impl.CartDaoImpl;
import exception.InputExecption;
import po.Cart;
import service.CartService;

public class CartServiceImpl implements CartService {
	private CartDao cartDao = new CartDaoImpl();
	@Override
	public Integer addCart(Cart cart) {
		if(cart.getAid().equals("") || cart.getDid().equals(""))
			throw new InputExecption("购物车商品必须有商品di和用户id，才能入库");
		return cartDao.addCart(cart);
	}
	@Override
	public Map<Integer, Integer> findCartByAid(String aid) {
		return cartDao.findCartByAid(aid);
	}

}
